<template>
	<view class="hash-view">
		<view class="hash-title" :style=" titleStyle ? titleStyle : '' ">产品hash:</view>
		<view class="row-div">
			<view class="hashcode-text">{{code || ''}}</view>
			<view class="column-div copy-view" @click.stop="copyEvent(code)">
				<image src="/static/assets/copy.png" style="width: 30upx;height: 30upx;margin-bottom: 6upx;"></image>
				<view>复制</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props:{
			titleStyle:{ type: Object, default: null },
			code:{ type: String, default: '' }
		},
		data() {
			return {
				
			}
		},
		methods: {
			copyEvent(e) {
				uni.setClipboardData({
					data: e,
					success: () => uni.showToast({title:'已复制'})
				})
			},
		}
	}
</script>

<style scoped lang="scss">
	.hash-view{
		.hashcode-text {
			flex: 1;
			font-size: 26upx;
			word-break: break-all;
			font-family: PingFang SC;
			font-weight: 500;
			color: #FE5E49;
			line-height: 42upx;
		}
		.copy-view {
			width: 90upx;
			height: 90upx;
			border: 1upx solid #EEEEEE;
			box-shadow: 0upx 3upx 8upx 0upx rgba(172, 170, 170, 0.1);
			border-radius: 45upx;
			font-size: 22upx;
			font-weight: 500;
			margin-left: 43upx;
			image {
				width: 30upx;
				height: 30upx;
				margin-bottom: 6upx;
			}
		}
	}
	.hash-title{
		font-size: 26upx;
		font-family: PingFang SC;
		font-weight: bold;
		color: #333333;
		margin-bottom: 25upx;
	}
</style>
